-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[RISCV] Add Predicates to fcanonicalize patterns. NFC #158709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This doesn't matter in practice since the only way fcanonicalize can make it to isel is if the predicate is already true, but it's good to be consistent.
@llvm/pr-subscribers-backend-risc-v Author: Craig Topper (topperc) ChangesThis doesn't matter in practice since the only way fcanonicalize can make it to isel is if the predicate is already true, but it's good to be consistent. Full diff: https://github.com/llvm/llvm-project/pull/158709.diff 3 Files Affected:
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoD.td b/llvm/lib/Target/RISCV/RISCVInstrInfoD.td
index 414e093510607..3d9737e3645d5 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoD.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoD.td
@@ -401,6 +401,7 @@ foreach Ext = DExts in {
defm : PatFprFpr_m<fmaximumnum, FMAX_D, Ext>;
defm : PatFprFpr_m<riscv_fmin, FMIN_D, Ext>;
defm : PatFprFpr_m<riscv_fmax, FMAX_D, Ext>;
+ let Predicates = Ext.Predicates in
def : Pat<(f64 (fcanonicalize FPR64:$rs1)), (FMIN_D $rs1, $rs1)>;
}
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoF.td b/llvm/lib/Target/RISCV/RISCVInstrInfoF.td
index 84a75666e5f36..2c1cf77acff56 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoF.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoF.td
@@ -655,6 +655,7 @@ foreach Ext = FExts in {
defm : PatFprFpr_m<fmaximumnum, FMAX_S, Ext>;
defm : PatFprFpr_m<riscv_fmin, FMIN_S, Ext>;
defm : PatFprFpr_m<riscv_fmax, FMAX_S, Ext>;
+ let Predicates = Ext.Predicates in
def : Pat<(f32 (fcanonicalize FPR32:$rs1)), (FMIN_S $rs1, $rs1)>;
}
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td
index b3554ba81e387..014da990a0146 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td
@@ -380,6 +380,7 @@ foreach Ext = ZfhExts in {
defm : PatFprFpr_m<fmaximumnum, FMAX_H, Ext>;
defm : PatFprFpr_m<riscv_fmin, FMIN_H, Ext>;
defm : PatFprFpr_m<riscv_fmax, FMAX_H, Ext>;
+ let Predicates = Ext.Predicates in
def : Pat<(f16 (fcanonicalize FPR16:$rs1)), (FMIN_H $rs1, $rs1)>;
}
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/31150 Here is the relevant piece of the build log for the reference
|
This doesn't matter in practice since the only way fcanonicalize can make it to isel is if the predicate is already true, but it's good to be consistent.
This doesn't matter in practice since the only way fcanonicalize can make it to isel is if the predicate is already true, but it's good to be consistent.
This doesn't matter in practice since the only way fcanonicalize can make it to isel is if the predicate is already true, but it's good to be consistent.